var $springboot = {
	msgIdx : 0,
	msg : function(msg, second) {
		second = second || 1;
		this.msgIdx++;
		var panel = $("#msg-panel");
		if ($(".msg-panel").length == 0) {
			$("body").append('<div class="msg-panel"></div>');
		}
		var id = "msg-" + this.msgIdx;
		$(".msg-panel").append('<div class="msg" id="' + id + '">' + msg + '</div>');
		$('#' + id).oneTime(second + 's', function() {
			$('#' + id).remove();
		});
	},

	getContextPath : function() {
		var pathName = document.location.pathname;
		var index = pathName.substr(1).indexOf("/");
		var result = pathName.substr(0, index + 1);
		return result;
	},
	get : function(url, data, callback) {
		$.ajax({
			url : this.getContextPath() + url,
			async : false,
			data : data || {},
			type : "get",
			dataType : "json",
			success : function(rs) {
				if (callback)
					callback(rs);
			}
		});
	},
	post : function(url, data, callback) {
		$.ajax({
			url : this.getContextPath() + url,
			async : false,
			data : data || {},
			type : "post",
			dataType : "json",
			success : function(rs) {
				if (callback)
					callback(rs);
			}
		});
	}
};